package cn.javass.dp.abstractfactory.example1;

public class CPUFactory {

    //静态工厂方式获取CPU
    public static CPUApi getCPU(int type) {
        CPUApi cpu = null;
        if (type == 1) {
            cpu = new InterCPU(1156);
        } else if (type == 2) {
            cpu = new AMDCPU(939);
        }
        return cpu;
    }
}
